package com.antoco.operation.bigscreen.model.dto;

import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import com.antoco.operation.bigscreen.commons.annotation.IsSensorExist;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@Data
@ApiModel(value="SensorReportDTO")
public class SensorReportDTO {

    @NotNull(message = "传感器id不能为空")
    @Digits(integer = 10, fraction = 0, message = "传感器id必须是数字")
    @IsSensorExist
    @ApiModelProperty(value = "传感器id", example="1")
    private Long sensorId;

    @NotNull(message = "通信值不能为空")
    @Min(value = 0, message = "通信值必须是正整数")
    @Digits(integer = 10, fraction = 0, message = "通信值必须是整数")
    @ApiModelProperty(value = "通信值", example="300")
    private String reportVal;
}